#ifndef DBUSVALUEDELEGATE_HPP
#define DBUSVALUEDELEGATE_HPP

#include <QStyledItemDelegate>
#include <QLineEdit>
class DBusArgvItem;
class DBusValueDelegate : public QStyledItemDelegate
{
    Q_OBJECT
public:
    enum BytesShowMode {
        BytesShowMode_String = 0,
        BytesShowMode_HEX = 1,
        BytesShowMode_NUMBER = 2,
    };
    explicit DBusValueDelegate(QObject *parent = nullptr);


public slots:

    // QAbstractItemDelegate interface
public:
    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
    void setEditorData(QWidget *editor, const QModelIndex &index) const override;
    void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override;
    int getBytes_show_mode() const;
    void setBytes_show_mode(int value);
    void setValidator(const DBusArgvItem *item,QLineEdit *editer) const;

private:
    int bytes_show_mode;

    // QStyledItemDelegate interface
protected:
//    void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const override;
};









#endif // DBUSVALUEDELEGATE_HPP
